3.204 \(\int x \cos ^2(x) \cot ^2(x) \, dx\)

Optimal. Leaf size=33 \[ -\frac{3 x^2}{4}-\frac{\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac{1}{2} x \sin (x) \cos (x) \]

[Out]

(-3*x^2)/4 - Cos[x]^2/4 - x*Cot[x] + Log[Sin[x]] - (x*Cos[x]*Sin[x])/2

________________________________________________________________________________________

Rubi [A]  time = 0.0546779, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {4408, 3310, 30, 3720, 3475} \[ -\frac{3 x^2}{4}-\frac{\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac{1}{2} x \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[x]^2/4 - x*Cot[x] + Log[Sin[x]] - (x*Cos[x]*Sin[x])/2

Rule 4408

Int[Cos[(a_.) + (b_.)*(x_)]^(n_.)*Cot[(a_.) + (b_.)*(x_)]^(p_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Int[
(c + d*x)^m*Cos[a + b*x]^n*Cot[a + b*x]^(p - 2), x] + Int[(c + d*x)^m*Cos[a + b*x]^(n - 2)*Cot[a + b*x]^p, x]
/; FreeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x \cos ^2(x) \cot ^2(x) \, dx &=-\int x \cos ^2(x) \, dx+\int x \cot ^2(x) \, dx\\ &=-\frac{1}{4} \cos ^2(x)-x \cot (x)-\frac{1}{2} x \cos (x) \sin (x)-\frac{\int x \, dx}{2}-\int x \, dx+\int \cot (x) \, dx\\ &=-\frac{3 x^2}{4}-\frac{\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac{1}{2} x \cos (x) \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0250926, size = 33, normalized size = 1. \[ -\frac{3 x^2}{4}-\frac{1}{4} x \sin (2 x)-\frac{1}{8} \cos (2 x)-x \cot (x)+\log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[2*x]/8 - x*Cot[x] + Log[Sin[x]] - (x*Sin[2*x])/4

________________________________________________________________________________________

Maple [B]  time = 0.093, size = 76, normalized size = 2.3 \begin{align*}{\frac{1}{2\,\tan \left ( x \right ) } \left ( -x-{\frac{{x}^{2}\tan \left ( x \right ) }{2}} \right ) }-{\frac{\ln \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) }{2}}+\ln \left ( \tan \left ( x \right ) \right ) +{\frac{1}{2\,\tan \left ( x \right ) \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) } \left ( -{\frac{\tan \left ( x \right ) }{2}}-x-2\,x \left ( \tan \left ( x \right ) \right ) ^{2}-{x}^{2}\tan \left ( x \right ) -{x}^{2} \left ( \tan \left ( x \right ) \right ) ^{3} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(x)^2*cot(x)^2,x)

[Out]

1/2*(-x-1/2*x^2*tan(x))/tan(x)-1/2*ln(tan(x)^2+1)+ln(tan(x))+1/2*(-1/2*tan(x)-x-2*x*tan(x)^2-x^2*tan(x)-x^2*ta
n(x)^3)/tan(x)/(tan(x)^2+1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 0.5048, size = 138, normalized size = 4.18 \begin{align*} \frac{4 \, x \cos \left (x\right )^{3} - 12 \, x \cos \left (x\right ) -{\left (6 \, x^{2} + 2 \, \cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) + 8 \, \log \left (\frac{1}{2} \, \sin \left (x\right )\right ) \sin \left (x\right )}{8 \, \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="fricas")

[Out]

1/8*(4*x*cos(x)^3 - 12*x*cos(x) - (6*x^2 + 2*cos(x)^2 - 1)*sin(x) + 8*log(1/2*sin(x))*sin(x))/sin(x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \cos ^{2}{\left (x \right )} \cot ^{2}{\left (x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)**2*cot(x)**2,x)

[Out]

Integral(x*cos(x)**2*cot(x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.18014, size = 278, normalized size = 8.42 \begin{align*} -\frac{6 \, x^{2} \tan \left (\frac{1}{2} \, x\right )^{5} - 4 \, x \tan \left (\frac{1}{2} \, x\right )^{6} - 4 \, \log \left (\frac{16 \, \tan \left (\frac{1}{2} \, x\right )^{2}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right )^{5} + 12 \, x^{2} \tan \left (\frac{1}{2} \, x\right )^{3} - 12 \, x \tan \left (\frac{1}{2} \, x\right )^{4} + \tan \left (\frac{1}{2} \, x\right )^{5} - 8 \, \log \left (\frac{16 \, \tan \left (\frac{1}{2} \, x\right )^{2}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right )^{3} + 6 \, x^{2} \tan \left (\frac{1}{2} \, x\right ) + 12 \, x \tan \left (\frac{1}{2} \, x\right )^{2} - 6 \, \tan \left (\frac{1}{2} \, x\right )^{3} - 4 \, \log \left (\frac{16 \, \tan \left (\frac{1}{2} \, x\right )^{2}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right ) + 4 \, x + \tan \left (\frac{1}{2} \, x\right )}{8 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{5} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{3} + \tan \left (\frac{1}{2} \, x\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="giac")

[Out]

-1/8*(6*x^2*tan(1/2*x)^5 - 4*x*tan(1/2*x)^6 - 4*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1
/2*x)^5 + 12*x^2*tan(1/2*x)^3 - 12*x*tan(1/2*x)^4 + tan(1/2*x)^5 - 8*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan
(1/2*x)^2 + 1))*tan(1/2*x)^3 + 6*x^2*tan(1/2*x) + 12*x*tan(1/2*x)^2 - 6*tan(1/2*x)^3 - 4*log(16*tan(1/2*x)^2/(
tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x) + 4*x + tan(1/2*x))/(tan(1/2*x)^5 + 2*tan(1/2*x)^3 + tan(1/2*x)
)